//
//  CHAlertVController.swift
//  CHSimpleUI
//
//  Created by cyptt on 2022/6/2.
//

import UIKit

class CHAlertVController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    @IBAction func defaulAlertBtnClick(_ sender: UIButton) {
        
        let inputAlert:CHDefaultAlertView = CHDefaultAlertView()
    
        let cancelAction = CHAlertAction.init(title: "取消", style: CHAlertAction.Style.cancel,isClose: true) { action in
            print(action.title!)
        }

        inputAlert.addAction(cancelAction)

     
        
        let cancelAction2 = CHAlertAction.init(title: "确定", style: CHAlertAction.Style.default,isClose: false) { action in
       
        }
        inputAlert.addAction(cancelAction2)

        inputAlert.addTextField { textF in
            
        }
    
  
        inputAlert.setMessageColor(color: UIColor.gray)
        inputAlert.setMessagePisition(position: NSTextAlignment.center)
        inputAlert.setMessageFont(font:UIFont.systemFont(ofSize: 16))
        inputAlert.setContentCornerRadius(cor: 3)
        
        inputAlert.setTitleColor(color: UIColor.red)
        inputAlert.setTitleFont(font: UIFont.systemFont(ofSize: 20))
 
        inputAlert.cancelTitleColor = UIColor.red
        inputAlert.cancelBorderColor = UIColor.red
        inputAlert.cancelBorderW = 1
        
        inputAlert.btnCornerRadius = 10
        inputAlert.butttonFont = UIFont.systemFont(ofSize: 17)
        inputAlert.sureBtnColor = UIColor.blue
        inputAlert.sureTitleColor = UIColor.yellow
        
        inputAlert.show(title: "标题", msg: "")
    }
    

    @IBAction func inputAlertBtn(_ sender: Any) {
        
        let inputAlert:CHDefaultAlertView = CHDefaultAlertView()
    
        let cancelAction = CHAlertAction.init(title: "取消", style: CHAlertAction.Style.cancel,isClose: true) { action in
            print(action.title!)
        }

        
        inputAlert.addAction(cancelAction)

        let cancelAction2 = CHAlertAction.init(title: "确定", style: CHAlertAction.Style.default,isClose: false) { action in
       
            
             
        }
        inputAlert.addAction(cancelAction2)
//        inputAlert.textFBorderColor = UIColor.red
        inputAlert.textFCornerRadius = 10
        inputAlert.textFBorderW = 0.5
        inputAlert.btnCornerRadius  = 10
        inputAlert.isShowTextLine = true
        inputAlert.addTextField { textF, label in
            textF.placeholder = "0001"
            label.text = "欲拿来了"
        }
        inputAlert.addTextField { textF, label in
            textF.placeholder = "0001"
            label.text = "进订单发的来了"
        }
        inputAlert.addTextField { textF, label in
            textF.placeholder = "0001"
            label.text = "进来了"
        }
   

//        inputAlert.addTextField { textF, label in
//            textF.placeholder = "0002"
//            label.text = "进来了"
//        }
//
//        inputAlert.addTextField { textF, label in
//            textF.placeholder = "0003"
//            label.text = "进来了"
//        }
  
        
        inputAlert.show(title: "标题", msg: "")
    }
    
    @IBAction func alertCodeBtn(_ sender: UIButton) {
        let inputAlert:CHSMSCodeAlert = CHSMSCodeAlert()
    
        inputAlert.isShowTextLine = true
        let cancelAction = CHAlertAction.init(title: "取消", style: CHAlertAction.Style.cancel,isClose: true) { action in
            print(action.title!)
        }

        inputAlert.addAction(cancelAction)

     
        
        let cancelAction2 = CHAlertAction.init(title: "确定", style: CHAlertAction.Style.default,isClose: false) { action in
       
        }
        inputAlert.addAction(cancelAction2)

        inputAlert.addTextField { textF in
            textF.placeholder = "请输入手机号"
            
        }
     
      
    
  
//        inputAlert.setMessageColor(color: UIColor.gray)
//        inputAlert.setMessagePisition(position: NSTextAlignment.center)
//        inputAlert.setMessageFont(font:UIFont.systemFont(ofSize: 16))
//        inputAlert.setContentCornerRadius(cor: 3)
//
//        inputAlert.setTitleColor(color: UIColor.red)
//        inputAlert.setTitleFont(font: UIFont.systemFont(ofSize: 20))
//
//        inputAlert.cancelTitleColor = UIColor.red
//        inputAlert.cancelBorderColor = UIColor.red
//        inputAlert.cancelBorderW = 1
//
//        inputAlert.btnCornerRadius = 10
//        inputAlert.butttonFont = UIFont.systemFont(ofSize: 17)
//        inputAlert.sureBtnColor = UIColor.blue
//        inputAlert.sureTitleColor = UIColor.yellow
        
        
        inputAlert.show(title: "标题", msg: "")
    }
}
